package com.zhump.springcloud.netflix.consums.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * 服务消费放
 */
@RestController
@RequestMapping("/consums")
public class ConsumsController {

    @Autowired
    private RestTemplate restTemplate;

    @RequestMapping("/hello")
    public String test(){
        String result = restTemplate.getForObject("http://spring-cloud-netflix-eureka-provide/provide/hello", String.class);
        System.out.println("result:"+result);
        return result;
    }
}
